package com.dragon.graduation.roleMenu.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dragon.graduation.menu.entity.MenuEntity;
import com.dragon.graduation.roleMenu.entity.RoleMenuEntity;
import com.dragon.graduation.roleMenu.mapper.RoleMenuMapper;
import com.dragon.graduation.roleMenu.service.RoleMenuService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 角色菜单表 服务实现类
 * </p>
 *
 * @author dragon
 * @since 2025-02-28 21:21:44
 */
@Service
public class RoleMenuServiceImpl extends ServiceImpl<RoleMenuMapper, RoleMenuEntity> implements RoleMenuService {

    @Override
    public List<MenuEntity> getMenuByRole(Integer roleId) {
        return baseMapper.findMenuByRole(roleId);
    }

    @Override
    public void removeByRoleId(Integer roleId) {
        baseMapper.deleteByRoleId(roleId);
    }

    @Override
    public List<Integer> getMenuIdByRole(Integer roleId) {
        return baseMapper.findMenuId(roleId);
    }
}
